<?
function page_list($parent = 0, $sub_no = 0, $status = null) {
	use_db_drizzo();
	
	global $drizzo_posts, $drizzo_users, $drizzo_comments, $row_count, $drizzo_admin_images;

	if(!$status) {
		$page_query = mysql_query("SELECT * FROM `$drizzo_posts` WHERE `status`!='draft' AND `page_parent`='$parent' AND `type`='page' ORDER BY `page_order`,`ID` ASC");
		if(!$page_query) {
			echo "<p>No Pages were found.</p>";
		} else {

			while($row = mysql_fetch_array($page_query)) {
				$alt_check = ($alt & 1);
				if($alt_check == 0) { $alt_class = "alt"; $alt++; } else { $alt_class = ""; $alt--; }

				$id = "";
				$type = "";
				$title = "";
				$posted = "";
				$author_id = "";
				$author = "";
				$comments = "";
				$tags = "";
				$page_parent = "";

				$id = $row['ID'];
				$type = $row['type'];
				$title = $row['title'];
				$tags = $row['tags'];
				$posted = date("M d, Y - g:i A", $row['posted_date']);
				$author_id = $row['author'];
				$the_post[author] = $author_id;
				$the_post[ID] = $id;
				if($sub_no > 0) { $sub = "sub" . $sub_no; } else { $sub = ""; }
				$page_parent = $row['page_parent'];

				$author_query = mysql_query("SELECT `nice_name` FROM `$drizzo_users` WHERE `ID`='$author_id'");
				if($author_query) {
					while($row = mysql_fetch_array($author_query)) {
						$author = $row['nice_name'];
					}				
				}

				$comments_query = mysql_query("SELECT * FROM `$drizzo_comments` WHERE `post_id`='$id'");
				if($comments_query) {
					$comments = mysql_num_rows($comments_query);				
				} else {
					$comments = 0;
				}

				if($page_parent == $parent) {

					if ($row_count%2) { $alt = "alt"; } else { $alt = ""; }
					
					echo "<tr class=\"" . $alt . "\">\n";
					echo "\t<td class=\"center\" width=\"1\"><strong>" . $id . "</strong></td><td class=\"" . $sub . "\">" . $title . "</td><td>" . the_tags($id) . "</td><td class=\"center\" width=\"1\">" . $comments . "</td><td class=\"center\" width=\"1\">" . $author . "</td><td class=\"center\" width=\"1\"><img src=\"" . $drizzo_admin_images . "view.png\" alt=\"View this Post\" /></td><td class=\"center\" width=\"1\">" . edit_link_backend($id) . "</td><td class=\"center\" width=\"1\">" . delete_link_backend($id) . "</td>\n";
					echo "</tr>\n";

					$row_count++;

					page_list($id, $sub_no +1);
				}
			}
		}
	}
	
	if($status) {
		$page_query = mysql_query("SELECT * FROM `$drizzo_posts` WHERE `status`='$status' AND `type`='page' ORDER BY `ID` DESC");
		if(!$page_query) {
			echo "<p>No Pages were found.</p>";
		} else {

			while($row = mysql_fetch_array($page_query)) {
				$alt_check = ($alt & 1);
				if($alt_check == 0) { $alt_class = "alt"; $alt++; } else { $alt_class = ""; $alt--; }

				$id = "";
				$type = "";
				$title = "";
				$posted = "";
				$author_id = "";
				$author = "";
				$comments = "";
				$tags = "";
				$page_parent = "";

				$id = $row['ID'];
				$type = $row['type'];
				$title = $row['title'];
				$tags = $row['tags'];
				$posted = date("M d, Y \at g:i A", $row['posted_date']);
				$author_id = $row['author'];
				if($sub_no > 0) { $sub = "sub" . $sub_no; } else { $sub = ""; }
				$page_parent = $row['page_parent'];

				$author_query = mysql_query("SELECT `nice_name` FROM `$drizzo_users` WHERE `ID`='$author_id'");
				if($author_query) {
					while($row = mysql_fetch_array($author_query)) {
						$author = $row['nice_name'];
					}				
				}

				$comments_query = mysql_query("SELECT * FROM `$drizzo_comments` WHERE `post_id`='$id'");
				if($comments_query) {
					$comments = mysql_num_rows($comments_query);				
				} else {
					$comments = 0;
				}

				if ($row_count%2) { $alt = "alt"; } else { $alt = ""; }

				echo "<tr class=\"" . $alt . "\">\n";
				echo "\t<td class=\"center\" width=\"1\"><strong>" . $id . "</strong></td><td class=\"" . $sub . "\">" . $title . "</td><td>" . the_tags($id) . "</td><td class=\"center\" width=\"1\">" . $comments . "</td><td class=\"center\" width=\"1\">" . $author . "</td><td class=\"center\" width=\"1\"><img src=\"" . $drizzo_admin_images . "view.png\" alt=\"View this Post\" /></td><td class=\"center\" width=\"1\"><a href=\"" . admin_folder ."pages.php?edit=" . $id . "\"><img src=\"" . $drizzo_admin_images . "edit.png\" alt=\"Edit This Post\" /></a></td><td class=\"center\" width=\"1\"><a href=\"" . admin_folder ."pages.php?delete=" . $id . "\"><img src=\"" . $drizzo_admin_images . "delete.png\" alt=\"Delete this Post\" /></a></td>\n";
				echo "</tr>\n";

				$row_count++;
			}
		}
	}
}

function the_authors_dropdown($author = null) {
	global $the_post, $drizzo_users;
	
	use_db_drizzo();
	
	echo "<h3>Author</h3>\n";
	
	if($the_post) {
		$author = $the_post['author'];
	}
	
	$authors_lookup = mysql_query("SELECT `ID`,`nice_name`,`username` FROM `$drizzo_users` WHERE `user_level`!='0'");
	if($authors_lookup) {
		echo "<select name=\"author\">\n";
		while($row = mysql_fetch_array($authors_lookup)) {
			$author_id = "";
			$author_nicename = "";
			
			$author_id = $row['ID'];
			$author_nicename = $row['nice_name'];
			if(!$author_nicename) { $author_nicename = $row['username']; }
			if($author == $author_id) {
				echo "\t<option value=\"$author_id\" selected>" . $author_nicename ."</option>\n";
			} else {
				echo "\t<option value=\"$author_id\">" . $author_nicename ."</option>\n";
			}
		}
		echo "</select>\n";
	}
}

function the_types_dropdown() {
	global $the_post, $drizzo_posts;
		
	use_db_drizzo();
	
	echo "<h3>Type</h3>\n";

	if(!$the_post) {
		$preselected_type = pageid;
		if(pageid == "pages") {
			$preselected_type = "page";
		}
		$type = $preselected_type;
	} else {
		$type = $the_post['type'];
	}
	
	$types_lookup = mysql_query("SHOW COLUMNS FROM `$drizzo_posts` LIKE '%type%'");
	if($types_lookup) {
		echo "<select name=\"type\">\n";
		$types_array = mysql_fetch_array($types_lookup);
		preg_match_all("/'(.*?)'/", $types_array['Type'], $matches);
		$type_count = count($matches[0]);
		for($i = 0; $i < $type_count; $i++) {
			$types = preg_replace("/\'/", "", $matches[0][$i]);
			if($types == $type) {
				echo "\t<option value=\"" . $types . "\" selected>" . ucwords($types) . "</option>\n";
			} else {
				echo "\t<option value=\"" . $types . "\">" . ucwords($types) . "</option>\n";
			}
		}
		echo "</select>\n";
	} else {
		echo "SQL can suck my ass.";
	}	
}

function the_statuses_dropdown() {
	global $the_post, $drizzo_posts;
	
	use_db_drizzo();
	
	echo "<h3>Status</h3>\n";

	if(!$the_post) {
		$status = "draft";
	} else {
		$status = $the_post['status'];
	}
	
	$statuses_lookup = mysql_query("SHOW COLUMNS FROM `$drizzo_posts` LIKE '%status%'");
	if($statuses_lookup) {
		echo "<select name=\"status\">\n";
		$statuses_array = mysql_fetch_array($statuses_lookup);
		preg_match_all("/'(.*?)'/", $statuses_array['Type'], $matches);
		$status_count = count($matches[0]);
		for($i = 0; $i < $status_count; $i++) {
			$statuses = preg_replace("/\'/", "", $matches[0][$i]);
			if($statuses == $status) {
				echo "\t<option value=\"" . $statuses . "\" selected>" . ucwords($statuses) . "</option>\n";
			} else {
				echo "\t<option value=\"" . $statuses . "\">" . ucwords($statuses) . "</option>\n";
			}
		}
		echo "</select>\n";
	} else {
		echo "SQL can suck my ass.";
	}	
}

function the_parents_dropdown() {
	echo "<h3>Page Parent</h3>\n";
	echo "<select name=\"page_parent\">\n";
	echo "\t<option value=\"0\"></option>";
	the_parents_dropdown_loop();
	echo "</select>\n";
}

function the_parents_dropdown_loop($parents = 0, $sub_no = 0) {
	global $drizzo_posts, $the_post;

	$page_query = mysql_query("SELECT * FROM `$drizzo_posts` WHERE `status`!='draft' AND `page_parent`='$parents' AND `type`='page' ORDER BY `page_order`,`ID` ASC");
	
	if(!$the_post) {
		$parent_id = 0;
	} else {
		$parent_id = $the_post['page_parent'];
	}
	while($row = mysql_fetch_array($page_query)) {

		$id = "";
		$title = "";
		$page_parent = "";

		$id = $row['ID'];
		$title = $row['title'];
		$title = str_pad($title, (strlen($title) + $sub_no), "-", STR_PAD_LEFT);
		if(strlen($title) > 25) { $title = substr($title, 0, 22) . "..."; }
		$page_parent = $row['page_parent'];

		if($page_parent == $parents) {
			
			if($id == $parent_id) {
				echo "\t<option value=\"$id\" selected>" . $title . "</option>\n";
			} else {
				echo "\t<option value=\"$id\">" . $title . "</option>\n";
			}

			
			the_parents_dropdown_loop($id, $sub_no +1);
		}
	}
}

function the_comment_statuses_dropdown() {
	global $the_post, $drizzo_posts;
	
	use_db_drizzo();
	
	echo "<h3>Comment Status</h3>\n";

	if(!$the_post) {
		$status = 0;
	} else {
		$status = $the_post['comment_status'];
	}
	
	$statuses_lookup = mysql_query("SHOW COLUMNS FROM `$drizzo_posts` LIKE '%comment_status%'");
	if($statuses_lookup) {
		echo "<select name=\"comment_status\">\n";
		$statuses_array = mysql_fetch_array($statuses_lookup);
		preg_match_all("/'(.*?)'/", $statuses_array['Type'], $matches);
		$status_count = count($matches[0]);
		for($i = 0; $i < $status_count; $i++) {
			$statuses = preg_replace("/\'/", "", $matches[0][$i]);
			if($statuses == $status) {
				echo "\t<option value=\"" . $statuses . "\" selected>" . ucwords($statuses) . "</option>\n";
			} else {
				echo "\t<option value=\"" . $statuses . "\">" . ucwords($statuses) . "</option>\n";
			}
		}
		echo "</select>\n";
	} else {
		echo "SQL can suck my ass.";
	}	
}

function the_edit_status() {
	global $the_post, $drizzo_users, $action;
	
	if($action != "new") {
		echo "<h3>Last Edited</h3>\n";

		$editor = $the_post['edited_by'];
		$edit_date = $the_post['edited_date'];
		if($editor == 0) {
			$editor_nice_name = "unknown user";
		} else {
			$editor_query = mysql_query("SELECT `nice_name`,`username` FROM `$drizzo_users` WHERE `ID`='$editor'");
			if($editor_query) {
				while($row = mysql_fetch_array($editor_query)) {
					$editor_nice_name = $row['nice_name'];
					if(empty($editor_nice_name)) {
						$editor_nice_name = $row['username'];
					}
				}
			}
		}

		echo "<p>Last edited by " . $editor_nice_name . " on " . $edit_date . "</p>";
	} else {
		return false;
	}

}

function the_menu_name_input() {
	global $the_post;

	echo "<h3>Menu Name</h3>\n";
	echo "<input type=\"text\" name=\"menu_name\" value=\"" . $the_post['menu_name'] . "\"></input>\n";
}

function the_page_order_input() {
	global $the_post;

	echo "<h3>Page Order <input type=\"text\" name=\"page_order\" id=\"page_order\" value=\"" . $the_post['page_order'] . "\"></input></h3>\n";
}

function the_permalink_name_input() {
	global $the_post;

	echo "<h3>Permalink</h3>\n";
	echo "<input type=\"text\" name=\"permalink_name\" value=\"" . $the_post['permalink_name'] . "\"></input>\n";
}

function load_editor() {
	global $drizzo_options;
	$editor_lookup = mysql_query("SELECT `value` FROM `$drizzo_options` WHERE `name`='editor'");
	if($editor_lookup) {
		while($row = mysql_fetch_array($editor_lookup)) {
			$editor_name = $row['value'];
		}

		if($editor_name == "tinymce") {
			load_tinymce();
		}
		
		if($editor_name == "plaintext") {
			
		}
		
		return true;
	} else {
		return false;
	}
}

function load_tinymce() {
	global $drizzo_admin_js;
	
	echo 
	"<script type=\"text/javascript\" src=\"" . $drizzo_admin_js . "tiny_mce/tiny_mce.js\"></script>
	<script type=\"text/javascript\">
	tinyMCE.init({
		mode : \"exact\",
		elements : \"content\",
		theme : \"advanced\",
		strict_loading_mode : true,
		theme_advanced_buttons1 : \"bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,code,formatselect\",
		theme_advanced_buttons2 : \"\",
		theme_advanced_buttons3 : \"\",
		theme_advanced_toolbar_location : \"top\",
		theme_advanced_toolbar_align : \"left\",
		extended_valid_elements : \"a[name|href|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]\"
	});
	</script>";
}

function recent_tags($limit = 10) {
	global $drizzo_posts;
	
	$limit = " LIMIT 0," . $limit;
	
	if($limit == " LIMIT 0,0") {
		$limit = "";
	}
	
	use_db_drizzo;
	
	$tags_query = mysql_query("SELECT `tags` FROM `$drizzo_posts` ORDER BY `ID` DESC$limit");
	if($tags_query) {
		while($row = mysql_fetch_array($tags_query)) {
			$tags = $row['tags'];
			$tag = explode(", ", $tags);
			$tag_count = count($tag);
			for($i = 0; $i < $tag_count; $i++) {
				$tags_list[] .= $tag[$i];
			}
		}

		$tags_list_count = count($tags_list);

		@sort($tags_list);

		for($i = 0; $i < $tags_list_count; $i++) {
			$prev = $i - 1;
			if($tags_list[$i] != $tags_list[$prev]) {
				$tags_string[] .= $tags_list[$i];
			}
		}

		$tags_string_count = count($tags_string);
		
		@sort($tags_string);

		for($i = 0; $i < $tags_string_count; $i++) {
			if($i < ($tags_string_count - 1)) {
				$clean_tag = preg_replace("/-/", " ", $tags_string[$i]);
				$all_tags .= "<a href=\"javascript:void(0)\" onclick=\"document.editor.tags.value += '" . $tags_string [$i] . ", '\">" . $clean_tag . "</a>, ";
			} else {
				$clean_tag = preg_replace("/-/", " ", $tags_string[$i]);
				$all_tags .= "<a href=\"javascript:void(0)\" onclick=\"document.editor.tags.value += '" . $tags_string [$i] . ", '\">" . $clean_tag . "</a>";
			}
		}

		return $all_tags;

	} else {
		return false;
	}
}

function get_global_options($option_name = null) {
	global $drizzo_options;

	use_db_drizzo();
	if(!$option_name) {
		$options_query = mysql_query("SELECT * FROM `$drizzo_options` WHERE `owner` IS NULL ORDER BY `ID`");
		if($options_query) {
			while($row = mysql_fetch_array($options_query)) {
				$name = $row['name'];
				$drizzo_option[$name] = $row['value'];
			}

			return $drizzo_option;
		}
	} elseif($option_name) {
		$options_query = mysql_query("SELECT * FROM `$drizzo_options` WHERE `owner` IS NULL AND `name`='$option_name' LIMIT 1");
		if($options_query) {
			while($row = mysql_fetch_array($options_query)) {
				$drizzo_option = $row['value'];
			}

			return $drizzo_option;
		}
	} else {
		return false;
	}
}

function get_user_options($id, $option_name = null) {
	global $drizzo_options;

	use_db_drizzo();

	if(!$option_name) {
		$options_query = mysql_query("SELECT * FROM `$drizzo_options` WHERE `owner`='$id' ORDER BY `ID`");
		if($options_query) {
			while($row = mysql_fetch_array($options_query)) {
				$name = $row['name'];
				$drizzo_user_option[$name] = $row['value'];
			}

			return $drizzo_user_option;
		}
	} elseif($option_name) {
		$options_query = mysql_query("SELECT * FROM `$drizzo_options` WHERE `owner`='$id' AND `name`='$option_name' LIMIT 1");
		if($options_query) {
			while($row = mysql_fetch_array($options_query)) {
				$drizzo_user_option = $row['value'];
			}

			return $drizzo_user_option;
		}
	} else {
		return false;
	}
}

function timezone_offset($date) {
	global $drizzo_option;
	
	$gmt_offset = date("O") . "00";
	$server_offset = $drizzo_option['timezone_offset'] . "0000";
	if($drizzo_option['dst']['value'] == 0){
		$server_offset = "-" . $server_offset + (date("I") . "0000");
	}
	$date = $date + $gmt_offset + $server_offset;
	
	return $date;
}

function mysql_timezone_offset($date) {
	global $drizzo_option;
	
	$gmt_offset = date("O") . "00";
	$server_offset = $drizzo_option['timezone_offset'] . "0000";
	if($drizzo_option['dst']['value'] == 0){
		$server_offset = "-" . $server_offset + (date("I") . "0000");
	}
	$date = $date - $gmt_offset - $server_offset;
	
	return $date;
}

function move_to_warehouse() {
	global $drizzo_warehouse, $_POST;

	$old_id = $_POST['old_id'];
	$old_author = $_POST['old_author'];
	$old_type = $_POST['old_type'];
	$old_status = $_POST['old_status'];
	$old_page_parent = $_POST['old_page_parent'];
	$old_page_order = $_POST['old_page_order'];
	$old_title = addslashes(html_entity_decode($_POST['old_title']));
	$old_content = addslashes(html_entity_decode($_POST['old_content']));
	$old_tags = addslashes(html_entity_decode($_POST['old_tags']));
	$old_comment_status = $_POST['old_comment_status'];
	$old_edited_by = $_POST['old_edited_by'];
	$old_edited_date = $_POST['old_edited_date'];
	$old_date = $_POST['old_date'];
	$old_permalink_name = $_POST['old_permalink_name'];
	$old_menu_name = $_POST['old_menu_name'];
	$old_lat = $_POST['old_lat'];
	$old_lon = $_POST['old_lon'];

		$warehouse = mysql_query("INSERT INTO `$drizzo_warehouse` SET `author`='$old_author',`type`='$old_type',`status`='$old_status',`page_parent`='$old_page_parent',`page_order`='$old_page_order',`title`='$old_title',`content`='$old_content',`tags`='$old_tags',`comment_status`='$old_comment_status',`edited_by`='$old_edited_by',`edited_date`='$old_edited_date',`posted_date`='$old_date',`permalink_name`='$old_permalink_name',`menu_name`='$old_menu_name',`lat`='$old_lat',`lon`='$old_lon',`old_id`='$old_id'");

	if($warehouse) {
		$warehouse_limit = get_global_options("warehouse_limit");
		$old_warehouse_query = mysql_query("SELECT * FROM `$drizzo_warehouse` WHERE `old_id`='$old_id'");
		$old_warehouse_count = mysql_num_rows($old_warehouse_query);
		if($old_warehouse_count > $warehouse_limit) {
			$count = 0;
			while($row = mysql_fetch_array($old_warehouse_query)) {
				$id = "";
				$id = $row['ID'];
				$count++;
				if($count > $warehouse_limit) {
					@mysql_query("DELETE FROM `$drizzo_warehouse` WHERE `ID`='$id' LIMIT 1");
				}
			}
		}
		return true;
	} else {
		return false;
	}
}

function drafts_count($types = "blog,aside") {
	global $drizzo_posts;
	$drafts_count = 0;
	$current_user = session_user_id;

	$type_list = explode(",", $types);
	for($i =0; $i < count($type_list); $i++) {
		if($i < (count($type_list) -1)) {
			$type_string .= "'" . $type_list[$i] . "', ";
		} else {
			$type_string .= "'" . $type_list[$i] . "'";
		}
	}
	
	$types = $type_string;
	
	$drafts_number = mysql_query("SELECT * FROM `$drizzo_posts` WHERE `status`='draft' AND `type` IN ($types)");
	if($drafts_number) {
		while($row = mysql_fetch_array($drafts_number)) {
			$the_post['author'] = $row['author'];
			if($current_user == $the_post['author']) {
				$drafts_count++;
			} elseif(post_permissions_check()) {
				$drafts_count++;
			} else {
				$drafts_count = $drafts_count;
			}
		}
	} else {
		$drafts_count = "0";
	}
	return $drafts_count;
}

function trash_count() {
	global $drizzo_trashheap;
	$trash_count = 0;
	
	$trash_number = mysql_query("SELECT * FROM `$drizzo_trashheap` ORDER BY `deleted_date`");
	if($trash_number) {
		while($row = mysql_fetch_array($trash_number)) {
			$deleted_date = $row['deleted_date'];
			$the_post['author'] = $row['author'];
			if(((time() - $deleted_date) >= (10 * 24 * 60 * 60)) && post_permissions_check()) {
				$trash_count++;
			}
		}
	} elseif($trash_number && $delete && isset($_POST['delete_check'])) {
		$trash_count = $trash_count - 1;
	} else {
		$trash_count = "0";
	}
	return $trash_count;
}

function post_permissions_check() {
	global $drizzo_users, $the_post;
	
	use_db_drizzo();
	
	$post_owner = $the_post['author'];
	$user_lookup = @mysql_query("SELECT `user_level` FROM `$drizzo_users` WHERE `ID`='$post_owner' LIMIT 1");
	while($row = mysql_fetch_array($user_lookup)) {
		$owner_level = $row['user_level'];
	}
	$current_user_id = session_user_id;

	$user_lookup = @mysql_query("SELECT `user_level` FROM `$drizzo_users` WHERE `ID`='$current_user_id' LIMIT 1");
	while($row = mysql_fetch_array($user_lookup)) {
		$current_user_level = $row['user_level'];
	}
	
	if($current_user_id == $post_owner) {
		return true;
	} elseif(($current_user_level >= $owner_level) && ($current_user_level >= 2)) {
		return true;
	} else {
		return false;
	}
}

function edit_link_backend($id = null) {
	global $the_post, $drizzo_admin_images;
	
	if($id == null) {
		$id = $the_post['ID'];
	}
	
	if(post_permissions_check()) {
		$link_string = "<a href=\"" . admin_folder . pageid . ".php?edit=" . $id ."\" title=\"Edit This Post\"><img src=\"" . $drizzo_admin_images . "edit.png\" alt=\"Edit This Post\" /></a>";
	} else {
		$link_string = "<img src=\"" . $drizzo_admin_images . "edit_off.png\" alt=\"Edit This Post\" title=\"You do not have permission to edit this post.\" />";
	}
	
	return $link_string;
}

function edit_link($before = "[ ", $after = " ]") {
	global $the_post, $drizzo_admin_images;
	$type = $the_post['type'];
	$type_check = substr($type, -1, 1);
	$type_length = strlen($type);
	if($type_check == "s") { $type = substr($type, 0, $type_length - 1); }
	if(post_permissions_check()) {
		$link_string = $before . "<a href=\"" . admin_folder . $type . ".php?edit=" . $the_post['ID'] ."\" title=\"Edit This Post\">Edit</a>" . $after;
	} else {
		$link_string = null;
	}
	
	return $link_string;
}

function delete_link_backend($id = null) {
	global $the_post, $drizzo_admin_images;

	if($id == null) {
		$id = $the_post['ID'];
	}
	
	if(post_permissions_check()) {
		$link_string = "<a href=\"" . admin_folder . pageid . ".php?delete=" . $id ."\" title=\"Delete This Post\"><img src=\"" . $drizzo_admin_images . "delete.png\" alt=\"Delete This Post\" /></a>";
	} else {
		$link_string = "<img src=\"" . $drizzo_admin_images . "delete_off.png\" alt=\"Delete This Post\" title=\"You do not have permission to delete this post.\" />";
	}
	
	return $link_string;
}

?>